/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import java.time.LocalDate;

/**
 * <p>Project: JavaStudy - Var1
 * <p>Powered by jiangbo On 2023-01-30
 * 20:55:16
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Var1 {
    //成员变量，属性
    String name = "李四";
    //成员方法，main方法 入口方法，代码当前类可以直接执行
    public static void main(String[] args) {
//在方法中声明的变量叫局部变量
        String name;
        name = "李四";
        System.out.println(name);
//声明局部变量 变量名为i 类型为int 并直接初始化赋值为3
        int age = 3;
        System.out.println(age);
        age = 18;
//age = "hello"; 此语句是错误，java是强类型语言，数据类型必须匹配，
        System.out.println(age);
        System.out.println(age);
        System.out.println(age);
        System.out.println(age);
        System.out.println(age);
        System.out.println(age);
        System.out.println(age);
//java 10 有推断类型
        var wel = "欢迎光临";
        System.out.println(wel);
        var n = LocalDate.now();
        System.out.println(n);
    }
}


